Component({
    data: {
        bannerList: [],
        currentSwiper: 0,
        autoplay: true,
        interval: 3000,
        duration: 500
    },
    created() {
        this.getBanner()
    },
    methods: {
        swiperChange(ev) {
            this.setData({
                currentSwiper: ev.detail.current
            })
        },
        getBanner() {
            wx.request({
                url: 'https://www.kelionline.com/api/miniProgram/mnm/banners',
                method: 'GET',
                success: res => {
                    if (res.data.code == 0) {
                        this.setData({
                            bannerList: res.data.data
                        })
                    }
                }
            })
        }
    }
})